package com.mobi.cacti.rabbit.response;

import android.os.Parcel;
import android.os.Parcelable;

public class GraphCircuit implements Parcelable {

	public String CircuitID;
	public String Graph_Total_ID;
	public String Graph_Inter_ID;
	public String Graph_Domestic_ID;

	public boolean isTotalGraphExist()
	{
		return (!Graph_Total_ID.equalsIgnoreCase("") && Graph_Total_ID!=null);
	}
	
	public boolean isInterGraphExist()
	{
		return (!Graph_Inter_ID.equalsIgnoreCase("") && Graph_Inter_ID!=null);
	}
	
	public boolean isDomesticGraphExist()
	{
		return (!Graph_Domestic_ID.equalsIgnoreCase("") && Graph_Domestic_ID!=null);
	}
	
	public String getTotalGraph(GraphType type)
	{
		String url = "https://timonitorappuat.trueinternet.co.th/cactimobileservice/graph_image.php" +
				"?user=" + Cache.userInfo.UserName +
				"&password=" + Cache.userInfo.Password +
				"&local_graph_id=" + Graph_Total_ID +
				"&rra_id="+type.getValue();
		
		return url;
	}
	
	public String getInterGraph(GraphType type)
	{
		String url = "https://timonitorappuat.trueinternet.co.th/cactimobileservice/graph_image.php" +
				"?user=" + Cache.userInfo.UserName +
				"&password=" + Cache.userInfo.Password +
				"&local_graph_id=" + Graph_Inter_ID +
				"&rra_id="+type.getValue();
		
		return url;
	}
	
	public String getDomesticGraph(GraphType type)
	{
		String url = "https://timonitorappuat.trueinternet.co.th/cactimobileservice/graph_image.php" +
				"?user=" + Cache.userInfo.UserName +
				"&password=" + Cache.userInfo.Password +
				"&local_graph_id=" + Graph_Domestic_ID +
				"&rra_id="+type.getValue();
		
		return url;
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeString(CircuitID);
		dest.writeString(Graph_Total_ID);
		dest.writeString(Graph_Inter_ID);
		dest.writeString(Graph_Domestic_ID);
	}
}
